﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;

namespace ECGServer
{
    class Client
    {
        private IPEndPoint clientUDPEndPoint;
        private DateTime lastCommunicationTime;
        private NetworkStream stream;
        private int id; //used to indentify client in hastable of clients

        public Client()
        {
        }

        public Client(IPEndPoint TCPEndPoint)
        {
            this.clientUDPEndPoint = TCPEndPoint;
            this.clientUDPEndPoint.Port = Constants.UDP_PORT;
        }

        public NetworkStream Stream
        {
            get { return stream; }
            set { stream = value; }
        }

        public DateTime LastCommunicationTime
        {
            get { return lastCommunicationTime; }
            set { lastCommunicationTime = value; }
        }

        public IPEndPoint ClientUDPEndPoint
        {
            get { return clientUDPEndPoint; }
            set { clientUDPEndPoint = value; }
        }

        public int ID
        {
            get { return id; }
            set { id = value; }
        }
    }
}
